﻿@model asMeishi.web.Models.shop
@using publicLibrary
@using asMeishi.web
@using asMeishi.web.Models
@using asMeishi.web.Classes
        <!--店首信息-->
        <div class="shopBoxContent" id="contentPanle">
            <div class="contentRight" style=" width:360px; margin-bottom: 10px;">
                @Html.Partial("../sitePublic/p_googleMap")
            </div>
                <!--菜系--->
@*
                <div class="shopClassBox">
                    <span class="title">次菜系:</span>
                    <span class="shopClassMain" id="foodOtherClass" revise="true" inputValue="@Model.foodOtherClass">@publicDictApp.get("shopClass").tansValue(@Model.foodOtherClass.ToTryString(), "未知")</span>
                </div>*@

                <!--详细资料-->
                <ul class="shopMoreInfo" style="width:340px;">
                    <li>
                        <div class="shopIntro" revise="true" id="shopIntro" inputValue="@Model.intro">@Model.intro</div>
                    </li>
                    <li> 
                        <span class="label">规模：</span>
                        <span class="field" id="shopSize" inputValue="@Model.size" revise="true">
                            @publicDictApp.get("shopSize").tansValue(@Model.size.ToTryString(), "未知")
                        </span>
                        <span>
                            <span class="label">环境：</span>
                            <span class="field" id="shopEnvironment" inputValue="@Model.environment" revise="true">
                                @publicDictApp.get("shopEnvironment").tansValue(@Model.environment.ToTryString(), "未知")
                            </span>
                        </span>
                    </li>

                    <li>
                    <span>
                        <span class="label">地址:</span>
                        <span class="field" id="shopCity" revise="true" inputValue="@Model.city">@Model.city</span>
                    </span>
                    <span>
                        <span class="label">/</span>
                        <span class="field" id="shopArea" revise="true" inputValue="@Model.area">@Model.area</span>
                    </span>
                    <span>
                        <span class="label">/</span>
                        <span class="field" id="shopStreet" revise="true" inputValue="@Model.street">@Model.street</span>
                    </span>
                    </li>
@*                   <li>
                        <span class="label">地址：</span>
                        <span class="field" id="shopAddressStr" revise="true" inputValue="@Model.addressStr">@Model.addressStr</span>
                    </li>*@
@*                    <li>
                        <span class="label">支付类型</span>
                        <span class="field"><span  id="shopPay" revise="true" inputValue="@Model.pay">@publicDictApp.get("shopPay").tansValue(@Model.pay.ToTryString(), "未知")</span></span>
                    </li>
                    <li>
                        <span class="label">合作：</span>
                        <span class="field"><span id="shopAlly" revise="true" inputValue="@Model.ally">@publicDictApp.get("shopAlly").tansValue(@Model.ally.ToTryString(), "未知")</span></span>
                    </li>
                    <li>
                        <span class="label">会员</span>
                        <span class="field"><span id="shopMemberAble" revise="true" inputValue="@Model.member" inputType="有,无,未知">@Model.member.tranBoolValue("有", "无", "未知")</span></span>
                    </li>*@
                    <li>
                        <span class="label">适&#160;&#160;&#160;&#160;&#160;&#160;&#160;用</span>
                        <span class="field"> <span class="shopFit" id="shopFit" revise="true" inputValue="@Model.fit">@publicDictApp.get("shopFit").tansValue(@Model.fit.ToTryString(), "未知")</span></span>
                    </li>
@*                    <li>
                        <span class="label">地址：</span>
                        <span class="field" id="shopAddressCode" revise="true" inputValue="@Model.longitudeAndLatitude">@Model.longitudeAndLatitude</span>(代码)
                    </li>*@
                    <li>
                        <span class="label">电话：</span>
                        <span class="field" id="shopTelephone" revise="true" inputValue="@Model.telephone">@Model.telephone</span>                  
                    </li>
@*                    <li>
                        <span class="label">交通：</span>
                        <span class="field" id="shopPath" revise="true" inputValue="@Model.busPath">@Model.busPath</span>                    
                    </li>*@
                    <li>
                        @*<span class="label tags"></span>*@
                        <span class="shopUtilityTags" id="shopUtilityTags" revise="true" inputValue="@Model.utilityTags.tryJoin(",")">
                       
                        @Model.utilityTags.SplitToHTMLbyCode("<img src='"+baseConfig.siteThemePath+"images/UtilityTag0_var_.jpg'/>")

                       @* @publicDictApp.get("shopUtilityTag").tansValue(string.Join(",", Model.utilityTags));*@
                        </span>   
                    </li> 

                    </ul>
                
                <!--详细资料-->
                <!--促销优惠-->
                <div class="shopSales" revise="reviseSale" id="shopSales">

                    <div class="title">优惠促销</div>
                    @{
                        List<sale> sales = (Model.sales ?? new List<sale>()).ToList();
                    }

                    @foreach (var sitem in sales)
                    { 
                        <div class="sale" id="@sitem.Id" title="by @@@sitem.userName">
                            <span class="datetime">@sitem.datetime.ToShortDateString()</span>
                            @if (sitem.able == true)
                            { 
                                <span>@sitem.content </span>
                            }
                            else { 
                                <span style=" text-decoration:line-through; color:Gray" >@sitem.content  (过期) </span>
                            }
                      
                        </div>
                    }
                </div>

            
            <div>
            <div class="shopMainTopPic">
                <span class="arrow left hackLine"></span>
                <span class="arrow right hackLine"></span>
                    <div class="pics ">
                        @Model.picUrlList.ListToHTMLbyCode("<a href='/upload/shopPic/_var_' rel='lightbox[shopPic]'><img src='/upload/shopPic/s/_var_.jpg' class='xxx'/></a>", 10)
                    </div>
                

            </div>
                    <!---印象---->
                    <div style="width:260px; float:right;">
                     <form id="impressionForm">
                            <input type="text" name="content" id="impressionWord"/>
                            <input type="hidden" name="targetId" value="@Model.Id" />
@*                            <input type="radio" name="type" value="1" id="impressiontype1"/><label for="impressiontype1">顶它</label>
                            <input type="radio" name="type" value="0" id="impressiontype2"/><label for="impressiontype2">踩它</label>*@
                            <button type="button" class="btn-small btn-yellow"  onclick="addImpression()" title="提交">+</button>
                            
                            <button type="button" class="btn-f btn-small RightBottom" onclick="hideImpressionForm()" title="关闭">X</button>
                    </form>
                    <div class="shopImpressionsPanle">
                        <span class="title gcolor">印象点评</span><!-- <span class="exp">@ViewBag.impressionsNum 次人评价</span>-->
                        <div class="arrow"></div>
                        <div id="shopImpressionsBar" onclick="impressionEvent(event)">
                        </div>

                        <div id="impressionBtn" onclick="showImpressionForm();">
                            添加印象
                        </div>

                    </div>

                </div>
                <!--评价列表-->
                <fieldset id="commentsBar" style="width:480px">
                    <legend class="gcolor" >就餐点评 @Model.comment_number</legend>
                    <!--<button type="button" id="getCommentBtn">查看10条</button>-->
                </fieldset>
                <!--评价列表 end-->                
            </div>


        </div>
        <!--店首信息-->
        <script>
            new Date().toDateString
        </script>
<div class="codeTemp">
    <div id="commentTemp" class="comment">
        <div class="datetime"><span class="date _var">$["datetime"].replace(/\//g, "")</span><span class="time _var">$["datetime"].replace(/\//g, "")</span></div>
        <div class="avatar"><img src="@(baseConfig.siteThemePath)images/userNullPic.png" /></div>
        <div class="author"><a href="#" class="_var">$["userName"]</a></div>
        <div class="grads">
            <span>味道</span><span class="quality _var">$["quality"]</span>
            <span>服务</span><span class="service _var">$["service"]</span>
            <span>环境</span><span class="priceQuality _var">$["priceQuality"]</span>
            <span><span>人均花费 : </span><span class="_var">$["cost"]</span></span>
        </div>
@*        <div class="id _var">$["Id"]["val"]</div>
        <div class="clearFloat"></div>*@
        <div><span class="content _var">$["content"]</span></div>
        <div class="item"><span>推荐 : </span><a class="_var">$["food"]</a></div>

    </div>
    <div id="impressionTemp" class="impression" >
        <span class="datetime _var">$["datetime"].replace(/\//g,"")</span>
        <a class="author _var" >$["userName"]</a>
        <a><span class="content _var">$["content"]</span><span class="delBtn"></span></a>
    </div>
</div>
    <script>

        $(function () { getComments(0, 6);  getImpressions(0,8); });
    </script>